# -*- encoding:utf-8 -*-

from base import *

if os.environ.get('TEST'):         
    DATABASES={
        'default': {
            'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
            'NAME': ':memory:',                      # Or path to database file if using sqlite3.
            # The following settings are not used with sqlite3:
            'USER': '',
            'PASSWORD': '',
            'HOST': '',                      # Empty for localhost through domain sockets or '127.0.0.1' for localhost through TCP.
            'PORT': '',                      # Set to empty string for default.
        }        
        
    }
else:
    DATABASES = {
        'default': {
            'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
            # 'NAME': 'test_pts',                      # Or path to database file if using sqlite3.
            'NAME': 'db_apg',#'pts_37','moki_pts',#
            # The following settings are not used with sqlite3:
            'USER': 'root',
            'PASSWORD': 'root',
            'HOST': '127.0.0.1',                      # Empty for localhost through domain sockets or '127.0.0.1' for localhost through TCP.
            'PORT': '3306',                      # Set to empty string for default.
        }
    }


ROUT_MEDIA=True   # 用户开发时，路由media资源,可以不用设置

REDIS={
    'host':'localhost',
    'port':'6379',
    'db':'9'
}

PS_DOMAIN='http://localhost:4567'
PTS_DOMAIN='http://localhost:8000'
APG_DOMAIN='localhost:6789'


SUB_DOC=r'X:\\'   # media_url mount path


# from datetime import timedelta

# CELERYBEAT_SCHEDULE = {
    # 'add-every-30-seconds': {
        # 'task': 'studio.tasks.myadd',
        # 'schedule': timedelta(seconds=30),
        # 'args': (16, 16)
    # },
# }
# from celery.schedules import crontab
# CELERYBEAT_SCHEDULE = {
    # # Executes every Monday morning at 7:30 A.M
    # 'add-every-monday-morning': {
        # 'task': 'tasks.myadd',
        # 'schedule': crontab(hour=12, minute=18),
        # 'args': (16, 16),
    # },
# }

INTERNAL_IPS = (
    '0.0.0.0',
    '127.0.0.1',
)